const joi = require('joi')

//定义标题 分类Id 内容 发布状态的验证规则
const title = joi.string().required()
const cate_id = joi.number().integer().min(1).required()
const content = joi.string().required().allow('')//允许空字符串
const state = joi.string().valid('已发布','草稿').required()//值必须是已发布或草稿

exports.add_article_schema = {
  body:{
    title,
    cate_id,
    content,
    state
  }
}